import { defineConfig } from 'umi';
import routes from './routes';
import path from 'path';
import proxy from './proxy';

const { REACT_APP_ENV } = process.env;

export default defineConfig({
  nodeModulesTransform: {
    type: 'none',
  },
  layout: {
    navTheme: 'light',
    // 拂晓蓝
    primaryColor: '#1890ff',
    layout: 'mix',
    iconfontUrl: '//at.alicdn.com/t/c/font_2980618_yosz76uistf.js',
  },
  targets: {
    ie: 11,
  },
  routes: [
    ...routes,
    {
      path: '/',
      redirect: '/creation',
    },
    {
      title: '404',
      component: '@/pages/404',
    },
  ],
  proxy: proxy[REACT_APP_ENV || 'dev'],
  fastRefresh: {},
  alias: {
    '@public': path.join(__dirname, '../public'),
  },
});
